//
//  LXHomePluginCell.m
//  APMDemo
//
//  Created by Jack on 2020/8/21.
//  Copyright © 2020 LX. All rights reserved.
//

#import "LXHomePluginCell.h"

@interface LXHomePluginCell ()
/**icon 图片 */
@property (nonatomic, strong) UIImageView *iconImageView;
/** 标题 */
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation LXHomePluginCell

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)coder{
    self = [super initWithCoder:coder];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    UIImage *image         = [UIImage imageNamed:@""];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.frame        = CGRectMake(0, 0, 20, 20);
    imageView.contentMode  = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:imageView];
    
    self.iconImageView = imageView;

    UILabel *label = [[UILabel alloc] init];
    label.backgroundColor = [UIColor clearColor];
    label.textColor       = [UIColor blackColor];
    label.font            = [UIFont systemFontOfSize:13];
    label.textAlignment   = NSTextAlignmentCenter;
    label.adjustsFontSizeToFitWidth = YES;
    label.minimumScaleFactor        = 0.5;
    [self.contentView addSubview:label];
    
    self.titleLabel = label;
}

- (void)layoutSubviews{
    
    self.iconImageView.center = CGPointMake(self.bounds.size.width/2.0, self.bounds.size.height/2.0);
    self.titleLabel.frame     = CGRectMake(0, CGRectGetMaxY(self.iconImageView.frame)+5, self.bounds.size.width, 20);
}



@end
